<template>
  <div>
    <div class="out">
      <div
        class="out-item"
        v-for="(v,i) in arr"
        :key="i"
        :class="{'item-active':actived==i}"
        @click="handleClick(i)"
      >{{v.title}}</div>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [
        { title: "热门" ,actived:"/pd/listen/0"},
        { title: "精选" ,actived:"/pd/listen/1"},
        { title: "音乐" ,actived:"/pd/listen/2"},
        { title: "情感" ,actived:"/pd/listen/3"},
        { title: "二次元" ,actived:"/pd/listen/4"},
        { title: "萌新" ,actived:"/pd/listen/5"},
        { title: "附近" ,actived:"/pd/listen/6"},
      ],
       actived:""
    };
  },
  methods: {
    handleClick(i) {
      this.actived = i
      this.$router.replace(`/pd/listen/${i}`);
    }
  }
};
</script>

<style scoped>
.out {
  display: flex;
  flex-shrink: 0;
  overflow-x: scroll;
  line-height: 0.5rem;
}
.out-item {
  width: 1rem;
  flex-shrink: 0;
  line-height: 0.5rem;
  height: 0.5rem;
  text-align: center;
  font-size: 0.3rem;
  margin: auto;
  margin-bottom: 0.6rem;
  font-weight: 700;
  color: gray;

}
.item-active {
  color: red;
}
::-webkit-scrollbar {
  display: none;
}
</style>
